﻿//-----------------------------------------------------------------------
// <copyright file="Formula.cs" company="tuliprules.org">
//     Copyright (c) 2011 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the Formula class.</summary>
//-----------------------------------------------------------------------
namespace Tulip.Rules.Models.Rif.Core
{
    using System;
    using System.ComponentModel;
    using System.Xml.Serialization;

    /// <summary>
    /// Represents a formula role, containing a FORMULA.
    /// </summary>
    [Serializable]
    [DesignerCategory(@"code")]
    [XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2007/rif#")]
    [XmlRoot(Namespace = "http://www.w3.org/2007/rif#", IsNullable = false)]
    public class Formula : IRifCoreElement
    {
        /// <summary>
        /// The item field.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        private object itemField;

        /// <summary>
        /// Gets or sets a conjunction.
        /// </summary>
        [XmlElement("Atom", typeof(Atom), Order = 0)]
        [XmlElement("Frame", typeof(Frame), Order = 0)]
        [XmlElement("Member", typeof(Member), Order = 0)]
        [XmlElement("Equal", typeof(Equal), Order = 0)]
        [XmlElement("External", typeof(ExternalFormulaType), Order = 0)]
        [XmlElement("And", typeof(And), Order = 0)]
        [XmlElement("Or", typeof(Or), Order = 0)]
        [XmlElement("Exists", typeof(Exists), Order = 0)]
        public object Item
        {
            get
            {
                return this.itemField;
            }

            set
            {
                this.itemField = value;
            }
        }
    }
}
